//创建路由器并暴露

//1.引入路由器
import { createRouter, createWebHistory } from "vue-router";
//引入可能要呈现的组件
import Home from "@/components/Home.vue";
import About from "@/components/About.vue";
import News from "@/components/News.vue";
// 2.创建路由器
const router = createRouter({
    history: createWebHistory(),//路由器的工作模式
    routes: [
        {//一个个路由规则
            path: './home',
            component: Home
        },
        {//一个个路由规则
            path: './about',
            component: About
        },
        {//一个个路由规则
            path: './news',
            component: News
        }]
})

//暴露router
export default router